package com.yj_app.qualitytest.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yj_app.qualitytest.R;
import com.yj_app.qualitytest.info.QScoreInfo;

import java.text.DecimalFormat;
import java.util.List;

public class CheckContentAdapter extends BaseQuickAdapter<QScoreInfo, BaseViewHolder> {

    public CheckContentAdapter(int layoutResId, @Nullable List<QScoreInfo> data) {
        super(layoutResId, data);
    }



    @Override
    protected void convert(@NonNull BaseViewHolder helper, QScoreInfo item) {
        DecimalFormat decimalFormat = new DecimalFormat("###0.#");
        helper  .addOnClickListener(R.id.rating_score)
                .setText(R.id.rating_score,item.getScore()==0?"":decimalFormat.format(item.getScore()))
                .setText(R.id.check_content,item.getItemname());

    }
}
